package com.srlg.model.entity;

import io.quarkus.hibernate.orm.panache.PanacheEntity;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * @desc:
 * @author: srlg li
 * @date: 2024/12/26 下午11:08
 */
@EqualsAndHashCode(callSuper = false)
@Entity(name = "user")
@NamedQuery(name = "Users.findAll", query = "SELECT f FROM user f ORDER BY f.name", hints = @QueryHint(name = "org.hibernate.cacheable", value = "true"))
@Data
@Cacheable
public class User {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(length = 40, unique = true)
    private String name;

    private String age;

    private String gender;

    private String email;
}
